home *** CD-ROM | disk | FTP | other *** search
- Path: enea.se!usenet
- From: tope@enea.se (Tommy Petersson)
- Newsgroups: comp.lang.c++
- Subject: Re: VC++ 4.0 OLE Components: CPicClipCtrl / CPicture - HELP!
- Date: 5 Mar 1996 17:22:36 GMT
- Organization: Enea Data AB
- Message-ID: <4hht8s$6q8@gordon.enea.se>
- References: <4hf9mn$33j@gordon.enea.se>
- NNTP-Posting-Host: fixotrix.enea.se
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
- In article <4hf9mn$33j@gordon.enea.se>, tope@enea.se says...
- >
- >Hi, I have a problem with Visual C++ 4.0:
- >
- >In a dialog I need to display a small picture in a window, but
- >the picture displayed will depend on a value in a variable. For
- >this I use the MS-supplied OLE component Picture Clip Control.
- >
- >The control stores a matrix of small pictures in an object of
- >class CPicture and by a call to GetGraphicCell I get the chosen
- >part of the matrix returned as a CPicture object.
- >
- >However, the supplied documentation is totally Visual Basic-
- >oriented - it just tells me to "set the picture property to the
- >value returned by the GraphicCell call". Usually a picture control
- >in VB corresponds to a Static Bitmap control in VC++. Just use
- >the SetBitmap member function.
- >
- >But - SetBitmap wants a struct HWND and GetGraphicCell returns
- >a CPicture... And I can't find anything useful in the CPicture
- >class, since it's not derived fron CWnd or any other class where you
- >just call another member function which kindly returns a window.
- >
- >Shouldn't I use a static control? Should I put a CPicture in
- >the dialog instead? How do I get to it then - for the other controls
- >in the dialog I simply let ClassWizard add member variables but
- >ClassWizard doesn't understand CPicture. If I change from CStatic
- >to CPicture I get an error at the DDX call. And I don't think that
- >a CPicture is automatically displayed in a dialog the same way as
- >a CStatic is(?)
- >
- >Thanks in advance,
- >BTW - is this the best newsgroup for this question, I found no VC++
- >specific?
- >
- >Tommy Petersson
- >tope@enea.se
- >
-
- A MicroSoft tip is to use the MS OLE Grid Control and have it show
- a picture. Their example puts some code into OnInitDialog:
-
- CPictureHolder pictholder;
- pictholder.CreateFromBitmap(IDR_MAINFRAME);
- m_grid.SetPicture(pictholder.GetPictureDispatch());
-
- And that's of course great if I want to display the toolbar in a
- dialog... But if I have a CPicture returned from GetGraphicCell?
- Where does it come in?
-
- /Tommy Petersson
- tope@enea.se
-
-